package cn.buddha.jec.controller;

import cn.buddha.jec.annotation.TongSecurityParameter;
import cn.buddha.jec.flowable.FlowableExecute;
import cn.buddha.jec.model.FlowableTestIn;
import cn.buddha.jec.model.FlowableTestOut;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName FlowableTestController
 * @Author 友野浩二
 * @Date 2020/4/8 23:48
 * @Description 服务流程测试控制器
 * @Version 1.0
 */
@RestController
@RequestMapping("/tonghao")
@Slf4j
public class FlowableTestController {

    @Resource
    private FlowableExecute flowableExecute;

    @TongSecurityParameter(inDecode = true, outEncode = true)
    @RequestMapping(value = "/flowable/test", method = RequestMethod.POST)
    public FlowableTestOut test(@RequestBody FlowableTestIn input) {
        return this.flowableExecute.start("flowableTest", input);
    }

}
